clear
load W_time1_eh0_comp1.out 
load W_time2_eh0_comp1.out
load ParEst_eh0_time0_Mex_all_boots ParEst_eh0_time0_Mex_all_boots
load ParEst_eh0_time1_Mex_all_boots ParEst_eh0_time1_Mex_all_boots

boot_t0=ParEst_eh0_time0_Mex_all_boots(:,end); 
boot_t1=ParEst_eh0_time1_Mex_all_boots(:,end);

theta= 10.^(ParEst_eh0_time0_Mex_all_boots(:,21));
a=1000*ParEst_eh0_time0_Mex_all_boots(:,22);
gamma = 500*ParEst_eh0_time1_Mex_all_boots(:,1);

w_mom0=W_time1_eh0_comp1(boot_t0,17); % Read wage moments
p50wi_1=w_mom0; 
HH_avg_Inc = p50wi_1; % median wage of informal men
MWP_a_boot = a./(exp(-theta.*HH_avg_Inc));

for i= boot_t0'
    for j= boot_t1'
    if i==j
        auxtheta(j)= 10.^(ParEst_eh0_time0_Mex_all_boots(find(ParEst_eh0_time0_Mex_all_boots(:,25)==i),21));   
    end
    end
end
theta_1= nonzeros(auxtheta);
w_mom1=W_time2_eh0_comp1(boot_t1,17); % Read wage moments
p50wi_1=w_mom1; 
HH_avg_Inc = p50wi_1; % median wage of informal men
MWP_gamma_boot = gamma./(exp(-theta_1.*HH_avg_Inc));

save MWP_a_boot MWP_a_boot
save MWP_gamma_boot MWP_gamma_boot